package com.project.bean;

import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

/**
 * @Author(王思翰)
 * @Description(类的描述)
 * @Date(创建时间) 2021/7/30 10:57
 */
public class UserBean {
    private int id;
    @NotBlank(message = "姓名不能为空")
    private String name;
    @Length(min = 6,max = 6,message = "密码只能为6位字符")
    private String pwd;
    @Pattern(regexp = "1[3578]\\d{9}",message = "电话只能是13，15，16，18开始的11位数")
    private String phone;
    @Min(value = 1800,message ="工资最低不能低于1800")
    @Max(value = 100000,message = "你比老板还老板？")
    private int money;
    @Email(message = "邮箱格式为xxxx@xx.com")
    private String email;

    public UserBean() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", pwd='" + pwd + '\'' +
                ", phone='" + phone + '\'' +
                ", money=" + money +
                ", email='" + email + '\'' +
                "}\n";
    }
}
